import java.util.Arrays;
import java.util.Scanner;

public class Test {
    public static boolean fun5(int []arr){
        int count = 0;
        for (int left = 0; left < arr.length; left++) {
            if(arr[left]%2!=0){
                count++;
            }else if(count == 3){
                return true;
            }else{
                count = 0;
            }
        }
        return false;
    }
    public static void main(String[] args) {
        int[] arr = {1, 2, 34, 3, 4, 5, 7, 23, 12};
        boolean c = fun5(arr);
        System.out.println(c);

    }
    public static void main4(String[] args) {
        int [] array = {4,5,7,8,1,9,5,5,5,5,5,5,5};
        Arrays.sort(array);
        System.out.println(Arrays.toString(array));
        System.out.println(array[array.length/2]);
    }
    public static void main3(String[] args) {
        int [] array = {1,1,5,5,8};
        int sum = array[0];
        for (int i = 1; i < array.length; i++) {
            sum ^=array[i];
        }
        System.out.println(sum);
    }
    public static int[] fun2(int [] array,int tager){
        int [] ret=new int[]{-1,-1};
        for (int left = 0; left < array.length-1; left++) {
            for (int right = left+1; right < array.length; right++) {
                if(array[left]+array[right] ==  tager){
                    ret[0] = left;
                    ret[1] = right;
                    return ret;
                }
            }
        }
        return ret;
    }
    public static void main2(String[] args) {
        int array [] = {2,7,11,15};
        int tager = 9;
        int[] c = fun2(array,tager);
        System.out.println(Arrays.toString(c));

    }
    public static void func(int [] array){
        int left = 0;
        int right = array.length-1;
        while(left < right && array[left] % 2 != 0){
            left++;
        }
        while (left < right && array[right]%2 ==0) {
            right--;
        }
        if(left<right){
            int tmp = 0;
            tmp = array[left];
            array[left] = array[right];
            array[right]=tmp;
        }
        left++;
        right--;
    }
    public static void main1(String[] args) {
        int [] array = {1,2,3,4,5,6};
        System.out.println("交换前："+Arrays.toString(array));
        func(array);
        System.out.println("交换后;"+Arrays.toString(array));

    }
}
